<div id="result">
<div class="div_header1"  style="float: none;">Messages</div>
    <form accept-charset="utf-8" action="<?php echo Configure::read('base_url');?>messages/dispute_message" method="post" id="productmessage">
<table cellspacing="05" >
             <tbody>
<!--                 <tr>
                    <td style="color: #73AE0B; font-size: 15px;" >Write New Message</td>
                  </tr>-->
                <tr>
                    <td ><span style="padding-right:50px;">From: &nbsp;&nbsp;&nbsp;<b>
                    <?php echo $session->read('Auth.User.username');?></b></span><span style="padding-right:50px;">To: &nbsp;&nbsp;&nbsp;
                    <?php 
                    if($flag==2){
                    echo $disputeinfo['Seller']['username'];
                    }else{
                    echo $disputeinfo['Disputer']['username'];
                    }
                    ?></span>
                       </td>
                </tr>
                 <tr>
                    <td >Subject: Dispute Case ID #"<?php echo $disputeinfo['Dispute']['id'];?>"</td>
                  </tr>
                  <tr>
                    <td ></td>
                  </tr>
                  <tr>
                    <td >Message: </td>
                  </tr>
                   <tr>
                    <td >
                    <?php
                echo $this->Form->hidden('MessageTrack.case_id',array('value'=>$disputeinfo['Dispute']['id']));
		echo $this->Form->hidden('Message.subject',array('value'=>"Dispute Case ID #".'"'.$disputeinfo['Dispute']['id'].'"'));
		echo $this->Form->hidden('MessageTrack.to_id',array('value'=>$disputeinfo['Dispute']['id']));
		echo $this->Form->input('Message.message',array('cols'=>60,'class'=>'required','label'=>FALSE));
                ?>
                    </td>
                  </tr>
                 <tr>
                    <td >
                    <input type="submit" style="background:#73AE0B; color:#fff; font-size:14px;" name="button" id="button" value="Send" />
                    </td>
                  </tr>
                    <tbody>
                </table>
</form>
</div>
<?php  echo $html->script(array("jquery.min.js","jquery.form.js","jquery.validate.js")); ?>
<script type="text/javascript">
 jQuery(document).ready(function(){

// show a simple loading indicator
		var loader = jQuery('<div id="loader"><img src="<?php echo Configure::read('base_url');?>img/loading.gif" alt="loading..." /></div>')
			.css({position: "relative", top: "1em", left: "25em"})
			.appendTo("body")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});

		var v = jQuery("#productmessage").validate({
                    rules: {
                    },
      submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#result"
				});
			}
		});

            });
 </script>